home *** CD-ROM | disk | FTP | other *** search
- /* arexx Script
- Rotate Blur
- */
-
- call addlib("rexxmathlib.library", 5, -30, 0)
-
- options results
- parse ARG Port x1 y1 x2 y2 b
-
- ADDRESS COMMAND
- Alias=0
- Opacity=85
- Amplitude=5
- IF EXISTS('PerfectPaint:Prefs/Rexx_Prefs/RotateBlur') THEN DO
- IF OPEN('lfile','PerfectPaint:Prefs/Rexx_Prefs/RotateBlur', "R") then DO
- Amplitude= READLN('lfile')
- Opacity= READLN('lfile')
- Alias= READLN('lfile')
- CALL CLOSE('lfile')
- END
- END
-
- ADDRESS value Port
-
- pp_GetDepth
- D=result
- IF D<24 then DO
- pp_Warn 'This*script*is*only|for*24bits*Picture.'
- pp_PermitRefresh
- Exit
- END
-
- pp_DialogInit 250 95 "*Rotate*Blur*" 3
- pp_Integer 0 140 5 50 16 "Amplitude*(2-16)" 1 Amplitude
- pp_Integer 1 140 25 50 16 "Opacity*(0-100)" 1 Opacity
- pp_Cycle 2 140 45 50 16 "Antialiasing" 1 "None|Good|High" Alias
- pp_Dialog
- rc=result
- IF rc=0 then DO
- EXIT
- END
-
- pp_GetDialog 0
- Amplitude=result
-
- pp_GetDialog 1
- Opacity=result
-
- pp_GetDialog 2
- Alias=result
-
- CALL SavePrefs('RotateBlur',Amplitude,Opacity,Alias)
- ADDRESS value Port
-
- pp_StencilStat
- Stencil=result
-
- pp_PicttoSpare
- pp_SpareOnOff
-
- if Stencil=1 then DO
- pp_StencilOff
- END
-
- W=x2-x1+1
- H=y2-y1+1
-
- pp_BrushOpacity 50
-
- k=0.25
- j=0.125
-
- Mix=50
- Dec=2
- do i=1 to Amplitude
- pp_PickBrush x1 y1 W H 1
- pp_BrushEffect 0 0 0 j Alias
- pp_BrushOpacity Mix
- pp_plot x1+W/2 y1+H/2
- j=j+0.25
- Mix=Mix-Dec
- END
-
- IF Stencil=1 then DO
- pp_StencilOn
- END
-
- pp_FreeBrush
-
- pp_SpareOnOff
- pp_ComposeReqOff
- pp_UpdateUndoBox x1 y1 x2 y2
- pp_EffectOn
- pp_BrushOpacity 100
- pp_Spare
- pp_Compose 0 Opacity 0
- pp_Boxf x1 y1 x2 y2
- pp_EffectOff
- pp_ComposeReqOn
-
- EXIT
-
- SavePrefs: PROCEDURE
-
- Prefname='PerfectPaint:Prefs/Rexx_Prefs/'||ARG(1)
- say prefname
-
- if EXISTS(Prefname) THEN DO
- ADDRESS COMMAND
- 'delete >nil: '||Prefname
- END
-
- IF OPEN('pfile',PrefName,'W') THEN DO
-
- do i=2 to ARG()
- CALL WRITELN('pfile',ARG(i))
- end
-
- CALL CLOSE('pfile')
-
- RETURN
-
-